/**
 * Created with IntelliJ IDEA.
 * Description:运算符
 * User: liangyuanzhang
 * Date: 2024-11-25
 * Time: 10:39
 */
public class Test {
    public static void main(String[] args) {
        int a = 10;
        a += 2;
        System.out.println(a);

        int c = 10;
        long d = 20;
        //c = c +d;
        c += d;//这种运算符会帮你进行转换，一般情况下你注意不到
        System.out.println(c);
    }
    public static void main1(String[] args) {
        System.out.println(5/2);//2
//        System.out.println(5/0);//Exception...异常(算数异常)
//        0一定不能作为除数
        System.out.println(10%3);//1
        System.out.println(-10%3);//-1

        System.out.println(11.5%2.0);//可以对除法求余数

        System.out.println(1+2.0);

    }
}
